package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.example.erp.enums.OrderStatusEnum;
import org.example.erp.enums.OrderTypeEnum;

/**
 * 销售订单表
 * @TableName new_sales_order
 */
@TableName(value ="new_sales_order")
@Data
public class NewSalesOrder implements Serializable {
    /**
     * 销售订单ID，主键自增
     */
    @TableId(type = IdType.AUTO)
    private Integer salesOrderId;

    /**
     * 订单编码
     */
    private String salesOrderCode;

    /**
     * 订单名称
     */
    private String salesOrderName;

    /**
     * 订单状态,对应枚举类型
     */
    private OrderStatusEnum status;

    /**
     * 客户ID主键,关联客户
     */
    private Integer customerId;

    /**
     * 客户编码
     */
    private String customerCode;

    /**
     * 订货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date salesOrderDate;

    /**
     * 交货日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deliveryDate;

    /**
     * 订单类型,对应枚举类型
     */
    private OrderTypeEnum orderType;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 备注
     */
    private String remark;



    @TableField(exist = false)
    private List<NewSalesOrderItem> salesOrderItems;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}